home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / com / bbs / server / octps074 / script / pulldemo.scr < prev    next >
Encoding:
Text File  |  1996-05-18  |  15.5 KB  |  611 lines

  1. /*
  2.  * PULL-DOWN menu setup demo for the Octopus Bulletin Board System
  3.  * written by Koos Kuil on 18 May 1996
  4.  * -------------------------------------------------------------------
  5.  * Run this script using:    OCTOPUS -sPULLDEMO.SCR local
  6.  *
  7.  * This example is written in ONE .SCR file so please split it into
  8.  * several parts if you want to make use of it.
  9.  *
  10.  * IMPORTANT:    In Octopus v0.72alpha-6 it's required that the menu
  11.  *              library (beginning with #menulib) is put at the begin
  12.  *              of the script file.  This will be more flexible later.
  13.  */
  14.  
  15. /* -------------------------------------------------------------------
  16.  * Menu library for Pull-down menus, the #define MenuBarKeys is used
  17.  * in combination with all enddo... commands what makes it a lot
  18.  * easyer to handle this keys and avoid mistakes.  (Since v0.72a6
  19.  * this method is possible)
  20.  */
  21. #define MenuBarKeys "*MQFSTB CursLeft CursRight"
  22.  
  23. /* -------------------------------------------------------------------
  24.  * Here does begin out menu library, it should end with the #endlib
  25.  * statement, the empty line after each menu is important and does
  26.  * indicate Octopus that the end of a menu is reached.
  27.  */
  28. #menulib
  29.  
  30. Title [*]Main
  31. Entry [A]About Octopus
  32. Entry [I]What time is it?
  33. Entry [U]List of users
  34. Entry [Y]Yell the Sysop
  35. Entry [P]Upload to Path
  36. Entry [!]Quick Logoff
  37.  
  38. Title [M]Msgbase
  39. Entry MsgGroups[G]Msg Group
  40. Entry [R]Echo rules
  41. Entry [N]Scan new mail  
  42. Entry [!] Quick Logoff   
  43.  
  44. SubMenu MsgGroups
  45. Entry [1]Local mail     
  46. Entry [2]NeST           
  47. Entry [3]German         
  48. Entry [4]AtariNet       
  49. Entry [5]Fan mail       
  50.  
  51. Title [Q]QWK
  52. Entry [1]Change NDX files
  53. Entry [2]ChangeQwkBulletins
  54. Entry [3]ResetLastread
  55. Entry [4]UnmarkQwkAreas
  56. Entry [5]SetQwkMaxMsgs
  57. Entry [6]All msgs/one area
  58. Entry [7]All msgs/marked
  59. Entry [8]New msgs/one area
  60. Entry [9]New msgs/marked
  61. Entry [0]New msgs/marked/days
  62. Entry [A]Mark msg areas
  63. Entry [U]Upload reply's
  64. Entry [H]Help about QWK
  65.  
  66. Title [F]File
  67. Entry FileGroups[G]File Group
  68. Entry [L]List files
  69. Entry [N]New files
  70. Entry [K]Keyword search
  71. Entry [D]Download
  72. Entry [V]Verbose list
  73. Entry [U]Upload files
  74. Entry [A]Statistics
  75. Entry [P]Private upload
  76. Entry [!]Quick Logoff
  77.  
  78. SubMenu FileGroups
  79. Entry [1]ATARI
  80. Entry [2]GENERAL
  81. Entry [3]FANFILES
  82. Entry [4]NESTFILES
  83. Entry [X]All groups
  84.   
  85. Title [S]Statistics
  86. Entry [1]Last 15 Callers     
  87. Entry [2]Best 15 Downloaders 
  88. Entry [3]Best 10 Email writ. 
  89. Entry [4]Happy Birthday!     
  90. Entry [5]Your own status     
  91. Entry [6]Best 10 Netmail wrt.
  92. Entry [7]Filebase statistics 
  93. Entry [8]Best 15 Callers     
  94. Entry [9]Best 15 Uploaders   
  95. Entry [!]Quick Logoff
  96.  
  97. Title [T]Settings
  98. Entry [E]Screen Emulation
  99. Entry [H]Toggle Hotkeys
  100. Entry [O]Toggle moreprompt
  101. Entry [I]Toggle IBM graphics
  102. Entry [P]Change password
  103. Entry [L]New Screen-length
  104. Entry [W]New Screen-width
  105. Entry [R]Other date-format
  106. Entry [U]Def. Upload protocol
  107. Entry [D]Def. Download protocol
  108. Entry [A]Def. Archiver
  109. Entry [!]Quick Logoff
  110.  
  111. Title [B]Bulletins
  112. Entry [1]Atari Explorer
  113. Entry [2]Z-NET
  114. Entry [3]A-TOS (German)
  115. Entry [4]Dutch Net News
  116. Entry [5]Fido-News
  117. Entry [!]Quick Logoff
  118.  
  119. #endlib
  120.  
  121. /* -------------------------------------------------------------------
  122.  * MAIN startup function, the normal script file begins here...
  123.  * a little bit stripped but usable enough.
  124.  */
  125. Main
  126. SenseTerminal       /* Detect if remote supports ANSI */
  127. Login                /* Login, no luxe or other things */
  128. IfNoAccess            /* Drop the user if no access     */
  129.   Logout
  130. Endif
  131. DoMailScan Full        /* Do a little mailscan :-))      */
  132.  
  133. Gosub draw_bbsinfo
  134.  
  135. /* -------------------------------------------------------------------
  136.  * Begin of the "MAIN MENU" 
  137.  */
  138. :mainmenu
  139. Do
  140.    DrawMenu Main  Gosub draw_ascii_msg
  141.    DoMenu Main
  142.      Selectchoice
  143.          Case A   Convert InfoTxt
  144.          Case I   Convert Timedemo
  145.          Case U   UserList
  146.          Case Y   PageSysop
  147.          Case P   UploadToPath C:\PRIVE\
  148.          Case !   Gosub logoff
  149.  
  150.          /* The Common statement does clear the screen when we
  151.           * are NOT in ascii mode and rebuild the information on
  152.           * it.  It's like default but only activated when a choice
  153.           * is done in one if above Case statements.
  154.           */
  155.          Common   Gosub draw_bbsinfo
  156.      EndSelect
  157.    Enddochoice MenuBarKeys
  158.    RemoveMenu Main   
  159. Enddo MenuBarKeys
  160.  
  161. /* Check to what menu we should go */
  162. IfChoice CursLeft
  163.   Goto bulletin
  164. Else IfChoice CursRight
  165.        Goto msgbase
  166.      Else
  167.        Goto choice_action
  168.   Endif
  169. Endif
  170. End  /* End Octopus */
  171.  
  172. /* -------------------------------------------------------------------
  173.  * Begin of the "STATISTICS MENU" 
  174.  */
  175. :statistics
  176. Do
  177.    DrawMenu Statistics   Gosub draw_ascii_msg
  178.    DoMenu Statistics
  179.       SelectChoice
  180.          Case 1   ListLastCallers
  181.          Case 2   Convert 15_dnlds
  182.          Case 3   Convert 10_email
  183.          Case 4   Convert Birthday
  184.          Case 5   Convert Status
  185.          Case 6   Convert 10_nmail
  186.          Case 7   FileBaseStatistics
  187.          Case 8   Convert 15_calls
  188.          Case 9   Convert 15_uplds
  189.          Case !   Gosub logoff
  190.          Common   Gosub draw_bbsinfo
  191.       EndSelect
  192.    EnddoChoice MenuBarKeys
  193.    RemoveMenu Statistics
  194. Enddo MenuBarKeys
  195.  
  196. IfChoice CursLeft
  197.   Goto filebase
  198. Else IfChoice CursRight
  199.        Goto settings
  200.      Else
  201.        Goto choice_action
  202.   Endif
  203. Endif
  204. End   /* End Octopus */
  205.  
  206. /* -------------------------------------------------------------------
  207.  * Begin of the "USER SETTINGS" 
  208.  */
  209. :settings
  210. Do
  211.    DrawMenu Settings  Gosub draw_ascii_msg
  212.    DoMenu Settings
  213.       Selectchoice
  214.          Case E   ChangeEmulation
  215.          Case H   Gosub toggle_hotkeys
  216.          case I      Gosub toggle_highascii
  217.          Case O   Gosub toggle_moreprompt
  218.          Case P   ChangePassword
  219.          Case L   ChangeScreenLength
  220.          Case W   ChangeScreenWidth
  221.          Case F      Gosub toggle_dateformat
  222.          Case U   GetDefaultUp N
  223.          Case D   GetDefaultDown N
  224.          Case A   GetDefaultArchiver N
  225.          Case !   Gosub logoff
  226.          Common   Gosub draw_bbsinfo
  227.      EndSelect
  228.    EnddoChoice MenuBarKeys
  229.    RemoveMenu Settings
  230. Enddo MenuBarKeys
  231.  
  232. IfChoice CursLeft
  233.   Goto statistics
  234. Else IfChoice CursRight
  235.        Goto bulletin
  236.      Else
  237.        Goto choice_action
  238.   Endif
  239. Endif
  240. End   /* End Octopus */
  241.  
  242. /* -------------------------------------------------------------------
  243.  * Begin of the "BULLETIN MENU"
  244.  */
  245. :bulletin
  246. Do
  247.    DrawMenu Bulletins  Gosub draw_ascii_msg
  248.    DoMenu Bulletins
  249.       Selectchoice
  250.          Case 1   Bulletin 'aeo_????.txt'
  251.          Case 2   Bulletin 'aeop????.???'
  252.          Case 3   Bulletin 'slmp???.asc'
  253.          Case 4   Bulletin 'stgd*.txt'
  254.          Case 5   Bulletin 'str???.txt'
  255.          Case 6   Bulletin 'znet*.*'
  256.          Case !   Gosub logoff
  257.          Common   Gosub draw_bbsinfo
  258.      EndSelect
  259.    EnddoChoice MenuBarKeys
  260.    RemoveMenu Bulletins
  261. Enddo MenuBarKeys
  262.  
  263. IfChoice CursLeft
  264.   Goto settings
  265. Else IfChoice CursRight
  266.        Goto mainmenu
  267.      Else
  268.        Goto choice_action
  269.   Endif
  270. Endif
  271. End   /* End Octopus */
  272.  
  273. /* -------------------------------------------------------------------
  274.  * Begin of the "MSGBASE MENU", this menu does also have a small
  275.  * SUB-MENU, take a very closed look at it how you can handle this
  276.  * with less full screen redraws and to get the highest speed.
  277.  */
  278. :msgbase
  279. Do
  280.    DrawMenu Msgbase  Gosub draw_ascii_msg
  281.    DoMenu Msgbase
  282.       Selectchoice  
  283.          Case N   Cls   DoMailScan Full
  284.          Case R   Bulletin echorule.txt
  285.          Case !   Gosub logoff
  286.          Common   Gosub draw_bbsinfo
  287.       Endselect
  288.  
  289.       /* For the message groups submenu the Case
  290.        * will result in a full redraw so we do this
  291.        * manually.
  292.        */
  293.       IfChoice G
  294.         IfAscii  EchoKey  Endif
  295.         DrawMenu MsgGroups   Gosub draw_ascii_msg
  296.         DoMenu MsgGroups
  297.           Selectchoice
  298.             Case 1   Do  GetMsgAreaList FULL
  299.                      ReadMessages           EnddoNoarea
  300.  
  301.             Case 2   Do  GetMsgAreaList FULL
  302.                      ReadMessages           EnddoNoarea
  303.         
  304.             Case 3   Do  GetMsgAreaList FULL
  305.                      ReadMessages           EnddoNoarea
  306.         
  307.             Case 4   Do  GetMsgAreaList FULL
  308.                      ReadMessages           EnddoNoarea
  309.         
  310.             Case 5   Do  GetMsgAreaList FULL
  311.                      ReadMessages           EnddoNoarea
  312.         
  313.             Common   Gosub draw_bbsinfo
  314.                      DrawMenu Msgbase
  315.           EndSelect
  316.         EnddoChoice MenuBarKeys
  317.  
  318.         /* Remove the submenu */
  319.          IfChoice CursLeft
  320.           RemoveMenu MsgGroups
  321.           ClrChoice               
  322.         Endif
  323.         
  324.         /* Don't loop again with the right cursor key */
  325.         IfChoice CursRight
  326.           RemoveMenu MsgGroups
  327.           Endif
  328.       Endif
  329.    EnddoChoice MenuBarKeys
  330.    RemoveMenu MsgBase
  331. Enddo MenuBarKeys
  332.  
  333. IfChoice CursLeft
  334.   Goto mainmenu
  335. Else IfChoice CursRight
  336.        Goto qwkreader
  337.      Else
  338.        Goto choice_action
  339.   Endif
  340. Endif
  341. End       /* End Octopus */
  342.  
  343. /* -------------------------------------------------------------------
  344.  * Begin of the "QWKREADER MENU"
  345.  */
  346. :qwkreader
  347. Do
  348.     DrawMenu QWK   Gosub draw_ascii_msg
  349.     DoMenu QWK
  350.       SelectChoice
  351.         Case 1  ChangeQwkNdx
  352.         Case 2  ChangeQwkBulletins
  353.         Case 3  ResetLastread
  354.         Case 4  UnmarkQwkAreas
  355.         Case 5  SetQwkMaxMsgs
  356.  
  357.         Case 6  GetMsgAreaList FULL     WriteQwkOneAll
  358.         Case 7  WriteQwkMarkedAll
  359.         Case 8  GetMsgAreaList FULL  WriteQwkOneNew
  360.         Case 9  WriteQwkMarkedNew
  361.         Case 0  WriteQwkMarkedDays
  362.  
  363.         Case A  MarkQwkAreas FULL
  364.         Case U  UploadQwkReplys       GetKey
  365.         Case H  Bulletin qwkhelp
  366.         Case !  Gosub 'logoff'
  367.         Common  Gosub draw_bbsinfo
  368.      Endselect
  369.    EnddoChoice MenuBarKeys
  370.    RemoveMenu QWK
  371. Enddo MenuBarKeys
  372.  
  373. IfChoice CursLeft
  374.   Goto msgbase
  375. Else IfChoice CursRight
  376.        Goto filebase
  377.      Else
  378.        Goto choice_action
  379.   Endif
  380. Endif
  381. End    /* End Octopus */
  382.  
  383. /* -------------------------------------------------------------------
  384.  * Begin of the "FILEBASE MENU", this menu does also have a small
  385.  * SUB-MENU, take a very closed look at it how you can handle this
  386.  * with less full screen redraws and to get the highest speed.
  387.  */
  388. :filebase
  389. SetFileGroup FULL      /* Set file group ATARI as default */
  390. SetMainArea  FULL
  391. Do
  392.    DrawMenu File   Gosub draw_ascii_msg
  393.    DoMenu File
  394.  
  395.       Selectchoice                                         
  396.          Case F   FileListing   
  397.          Case L   FileListing   
  398.          Case N   Newfiles      
  399.          Case K   KeywordSearch
  400.          Case D   Download
  401.          Case V   ShowFileInfo
  402.          Case U   Convert rules.upl    UploadtoArea
  403.          Case A   FileBaseStatistics
  404.          Case P   Convert private.upl  UploadPrivate
  405.          Case !   Gosub logoff
  406.          Common   Gosub draw_bbsinfo         
  407.       Endselect
  408.  
  409.       /* For the message groups submenu the Case
  410.        * will result in a full redraw so we do this
  411.        * manually.
  412.        */
  413.       IfChoice G
  414.         IfAscii  EchoKey  Endif
  415.         DrawMenu FileGroups     Gosub draw_ascii_msg           
  416.         DoMenu FileGroups
  417.          Selectchoice
  418.              Case 1   /* File group ATARI */
  419.              Case 2      /* File group GENERAL */
  420.              Case 3   /* File group FANFILES */
  421.              Case 4   /* File group NESTFILE */
  422.  
  423.              Case X   SetFileGroup FULL       /* Set Full group */
  424.                        FileListing
  425.  
  426.              Common   Gosub draw_bbsinfo
  427.                       DrawMenu File
  428.          EndSelect
  429.         EnddoChoice MenuBarKeys
  430.  
  431.         /* Remove the submenu */
  432.          IfChoice CursLeft
  433.           RemoveMenu FileGroups
  434.           ClrChoice               
  435.         Endif
  436.         
  437.         /* Don't loop again with the right cursor key */
  438.         IfChoice CursRight
  439.           RemoveMenu FileGroups
  440.           Endif
  441.         Endif
  442.     EnddoChoice MenuBarKeys    
  443.    RemoveMenu File
  444. Enddo MenuBarKeys
  445.  
  446. IfChoice CursLeft
  447.   Goto qwkreader
  448. Else IfChoice CursRight
  449.        Goto statistics
  450.      Else
  451.        Goto choice_action
  452.   Endif
  453. Endif
  454. End    /* End Octopus */
  455.  
  456. /* -------------------------------------------------------------------
  457.  * Some USER-functions (normal in USERBASE.SCR)
  458.  */
  459. :change_password
  460. ChangePassword
  461. Return
  462.  
  463. :change_emulation
  464. ChangeEmulation
  465. Return
  466.  
  467. :change_screenlength
  468. ChangeScreenLength
  469. Return
  470.  
  471. :change_screenwidth
  472. ChangeScreenWidth
  473. Return
  474.  
  475. :toggle_fullscred
  476. Send "\f***  Full Screen Message Editor ?  ***\r\n\n"
  477.      "@Y  Yes, use the full screen edit (not in ascii mode).\r\n"
  478.      "@N  No, use the internal message line-orientated editor.\r\n\n"
  479.      "Select: "
  480.  
  481. AskYesNo
  482. IfAskTrue
  483.     SetFullScrEd On
  484. Else
  485.     SetFullScrEd Off
  486. Endif
  487. Return
  488.  
  489. :toggle_moreprompt
  490. Send "\f***  Wait after each screen ?  ***\r\n\n"
  491.      "@Y  Yes, enable more prompt\r\n"
  492.      "@N  No, disable more prompt\r\n\n"
  493.      "Select: "
  494. AskYesNo
  495. IfAskTrue
  496.     SetMorePrompt On
  497. Else
  498.     SetMorePrompt Off
  499. Endif
  500. Return
  501.  
  502. :toggle_hotkeys
  503. Send "\r\n\nDo you want to use fast menu hotkeys @c1(Y,n)@c0 ? "
  504. AskYesNo
  505. EchoYesNo
  506. IfAskTrue
  507.     SetHotkeys On
  508. Else
  509.     SetHotkeys Off
  510. Endif
  511. Return
  512.  
  513. :toggle_dateformat
  514. Do
  515.   Send "\r\n\nSelect your favourite date format.\r\n\n"
  516.        "1. DD-MM-YYYY  (26 September 1995)\r\n"
  517.        "2. MM-DD-YYYY  (September 26th 1995)\r\n\n"
  518.   Send "Make your choice: "
  519.   DoChoice
  520.     Selectchoice
  521.       Case 1  SetAltDateFormat Off
  522.       Case 2  SetAltDateFormat  On
  523.     EndSelect
  524.   EnddoChoice 12
  525.   EchoKey
  526. Enddo 12
  527. Return
  528.  
  529. :toggle_highascii
  530. Send "\r\n\nDo you want to use high ascii (IBM graphics) @c1(Y,n)@c0 ? "
  531. AskYesNo
  532. EchoYesNo
  533. IfAskTrue
  534.     SetHighAscii On
  535. Else
  536.     SetHighAscii Off
  537. Endif
  538. Return
  539.  
  540. /* -------------------------------------------------------------------
  541.  * Begin of the "LOGOFF normal menu"
  542.  */
  543. :logoff
  544. Logout
  545. End
  546.  
  547. /* When you see this piece of script, you'll think
  548.  * why not using Select...EndSelect?   No, this
  549.  * will result in a nested loop and Octopus will
  550.  * exit after this.
  551.  *
  552.  * Because we are directly jumping from one function
  553.  * in another one, a Return command is not usable (this
  554.  * will result in a "Return without gosub").  We use
  555.  * the Goto command for this.
  556.  */
  557. :choice_action   /* Check choices */
  558. IfAscii
  559.    IfChoice MenuBarKeys
  560.       EchoKey
  561.    Endif
  562. Endif
  563.  
  564. IfChoice B   Goto bulletin   Endif
  565. IfChoice *   Goto mainmenu   Endif
  566. IfChoice F   Goto filebase   Endif
  567. IfChoice M   Goto msgbase    Endif
  568. IfChoice Q   Goto qwkreader  Endif
  569. IfChoice S   Goto statistics Endif
  570. IfChoice T   Goto settings   Endif
  571.  
  572. End
  573.  
  574. /* This subroutine shows us how we can put a little
  575.  * note at the end of our screen, be sure that you
  576.  * don't have pulldown menus that does override this
  577.  * text (on 14 May 1996 the screen rebuild is not 
  578.  * complete working).
  579.  *
  580.  * If you don't want it, put the "Cls" command after
  581.  * the "Common" statements, this will give (as in this
  582.  * function) only a clear-screen when required (when a
  583.  * menu option was selected).
  584.  *
  585.  * For ascii mode this function is useless because it's
  586.  * not possible in ascii to put text on the screen before
  587.  * menu redraw is done.
  588.  */
  589. :draw_bbsinfo
  590. IfNoAscii
  591.   Cls
  592.   Gotoxy 0,21
  593.   Send "   ----- You can put your own message text here for example on the -----\r\n"
  594.        "  ----- bottom of the screen, this text is not drawed in ascii mode -----"
  595.   
  596.   Gotoxy 0,19
  597.   Send "/// You can use your cursor keys or menu title/entry keys to make a choice. ///"
  598. Endif
  599. Return
  600.  
  601. /* Draw a little message when a menu is drawed on screen in
  602.  * ascii mode, this subroutine should called AFTER a "DrawMenu"
  603.  * command.
  604.  */
  605. :draw_ascii_msg
  606. IfAscii
  607.   Send "\r\n\nMake your choice `UF : "
  608. Endif
  609. Return
  610.  
  611. /* End PULLDEMO.SCR */